<template>
  <!-- 门诊工作统计 -->
  <div>
    <h1>门 诊 工 作 统 计 报 表</h1>
    <h3>时期：{{startDate}} 至 {{endDate}}</h3>
    <h2>医院名称:湖北省中医院</h2>
    <el-table :data="tableData" stripe border style="width: 100%">
      <el-table-column prop="tim7mc" label="时期" align="center" width></el-table-column>
      <el-table-column label="总诊疗人次" align="center" width>
        <el-table-column prop="tim7001" label="总计" align="center" width></el-table-column>
        <el-table-column label="门诊人次" align="center" width>
          <el-table-column prop="tim7002" label="计" align="center" width></el-table-column>
          <el-table-column prop="tim7003" label="专科人次" align="center" width></el-table-column>
          <el-table-column prop="tim7004" label="专家人次" align="center" width></el-table-column>
        </el-table-column>
        <el-table-column label="急诊人次" align="center" width>
          <el-table-column prop="tim7005" label="计" align="center" width></el-table-column>
          <el-table-column prop="tim7006" label="其中：出车" align="center" width></el-table-column>
          <el-table-column prop="tim7007" label="抢救人次" align="center" width></el-table-column>
          <el-table-column prop="tim7008" label="抢救成功人数" align="center" width></el-table-column>
          <el-table-column prop="tim7009" label="死亡人数" align="center" width></el-table-column>
        </el-table-column>
        <el-table-column prop="tim7010" label="出诊人次" align="center" width></el-table-column>
        <el-table-column prop="tim7033" label="赴家庭病床诊疗人次数" align="center" width></el-table-column>
      </el-table-column>
      <el-table-column label="观察室" align="center" width>
        <el-table-column prop="tim7011" label="收容病人数" align="center" width></el-table-column>
        <el-table-column prop="tim7012" label="死亡人数" align="center" width></el-table-column>
        <el-table-column prop="tim7013" label="病人占床日数" align="center" width></el-table-column>
      </el-table-column>
      <el-table-column prop="tim7014" label="健康检查人数" align="center" width></el-table-column>
      <el-table-column prop="tim7015" label="门诊手术例数" align="center" width></el-table-column>
      <el-table-column prop="tim7016" label="正副主任医师门诊人日数" align="center" width></el-table-column>
      <el-table-column prop="tim7017" label="正副主任医师门诊总工时数" align="center" width></el-table-column>
      <el-table-column prop="tim7018" label="日均正副主任医师出门诊数" align="center" width></el-table-column>
      <el-table-column prop="tim7019" label="急诊危重病人抢救成功率%" align="center" width></el-table-column>
      <el-table-column prop="tim7020" label="留观室病人平均留观日数" align="center" width></el-table-column>
      <el-table-column prop="tim7021" label="平均每日门诊急诊人次" align="center" width></el-table-column>
    </el-table>
  </div>
</template>

<script>
import { outpatientLedger } from "@/api";
import { showOkMsg, showErrorMsg } from "@/utils/index.js";

export default {
  data() {
    return {
      tableData: [],
      startDate: "",
      endDate: ""
    };
  },
  created() {
    this.getTableList();
  },
  props: ["dateList"],
  methods: {
    getTableList() {
      if (this.dateList.dateBegin && this.dateList.dateEnd) {
        outpatientLedger({
          kb: this.dateList.administrative,
          startTime: this.dateList.dateBegin,
          endTime: this.dateList.dateEnd
        }).then(res => {
          if (res.code === 0) {
            this.startDate = this.dateList.dateBegin;
            this.endDate = this.dateList.dateEnd;
            this.tableData = res.data;
            showOkMsg(res.msg);
          }
        });
      } else {
        showErrorMsg("请选择开始和结束日期");
      }
    }
  }
};
</script>

<style scoped>
h1 {
  font-size: 24px;
  text-align: center;
  padding: 23px 0;
}
h3 {
  text-align: center;
  padding-bottom: 20px;
}
h2 {
  padding: 4px 0;
  display: flex;
  justify-content: space-between;
}
</style>